<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/webjars/layui/2.5.5/css/layui.css">
    <script type="text/javascript" src="echarts.min.js"></script>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
</body>
<script type="text/javascript" src="/webjars/jquery/3.1.1/jquery.js"></script>
<script type="text/javascript" src="/webjars/layui/2.5.5/layui.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    $.ajax({
        type:"post",
        url:"/SelectCount",
        data:{
        },
        async:true,
        dataType:"json",
        success:function (data) {
            console.log()
            console.log()
            console.log()
            // 指定图表的配置项和数据
            var option = {
                title: {
                    text: '统计数据'
                },
                tooltip: {},
                legend: {
                    data:['人数']
                },
                xAxis: {
                    data: ["员工","客户","订单"]
                },
                yAxis: {},
                series: [{
                    name: '人数统计',
                    type: 'bar',
                    data: [data.user, data.customer, data.orders]
                }]
            };
            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option);
        }
    },JSON)
</script>
</html>